package com.ap.core.dao.impl;

import org.hibernate.Criteria;
import org.hibernate.criterion.Order;
import org.hibernate.criterion.Restrictions;

import com.ap.core.dao.AbstractReadOnlyAPCoreBaseJpaDao;
import com.ap.core.dao.BankDao;
import com.ap.core.domain.Bank;

/**
 * User: Rohit.Dixit
 * Jpa Implementation class for {@link com.ap.core.dao.BankDao}
 */
public class JpaBankDao extends AbstractReadOnlyAPCoreBaseJpaDao<Bank, Long> implements BankDao{

    @Override
    public Bank findById(Long primaryKey) {
        return findById(Bank.class, primaryKey);
    }
    
    @Override
	public Bank getBankByIdentification(String bankIdentification) {
        Criteria criteria = getSession().createCriteria(Bank.class);
        criteria.add(Restrictions.eq("bankIdentification", bankIdentification));
      return (Bank)criteria.uniqueResult();
	}

}
